﻿namespace complex.Controllers
{
    public class Page<T>
    {
        public T[] Items { get; set; }
        public int Total { get; set; }
        public int PageSize { get; set; }
        public int CurrentPage { get; set; }

        public int TotalPages()
        {
            var additionalPage = Total % PageSize == 0 ? 0 : 1;
            var pages = Total / PageSize + additionalPage;
            return pages;
        }
    }
}